package app

import (
	demoCtrl "cyiris/app/demo/ctrl"
	"cyiris/core/core"

	"github.com/kataras/iris/v12"
)

/**
 * 服务路由注册
 */
func SetupRoute() {
	httpServer := core.GetHttpServer()

	// isir app
	app := httpServer.App()

	// demo 模块路由配置
	app.PartyFunc("/demo", func(pty iris.Party) {
		// GET http://localhost:10001/demo/test
		pty.Post("/test", httpServer.HandlerFunc(demoCtrl.NewDemoCtrl()))
		pty.Get("/user", httpServer.HandlerFunc(demoCtrl.NewGetUserCtrl()))

		pty.Post("/redis/set", httpServer.HandlerFunc(demoCtrl.NewRedisCtrl()))
	})
}
